package control;

import java.io.IOException;
import java.io.PrintWriter;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.TirageMot;

public class FormulaireAction extends HttpServlet {

	public void doPost(	HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException {
 
		
		response.setContentType("text/html");
	    PrintWriter out = response.getWriter();
		 out.println ("avant jeu.jsp <br />" );
		request.getRequestDispatcher("jeu.jsp").forward(request, response);
		 out.println ("apres jeu.jsp <br />" );

		
		    // objet de type mot récupérant un mot aléatoire
          // TirageMot monTirage = new TirageMot();

     //      String lettre_t= request.getParameter("letter");
            
     //      char car = lettre_t.charAt(0) ;
    //       if (car=='M')
    //       {out.println ("Lettre tiree : "+car+"<br />" );
        	   
    //       }
    //        String mot_t = monTirage.getMot() ;
            
    //        int lg_mot_t = mot_t.length() ;
    //        StringBuffer mot_myst = new StringBuffer (lg_mot_t) ;
    //        
     //       for (int i=0; i<lg_mot_t;i++)
    //        {
    //        	if (mot_t.charAt(i) == car)
    //        	{
     //          		mot_myst.insert(i,car) ;
     //       	}
     //       	else
     //       		mot_myst.insert(i, '-' ) ;
     //       }
            
			
	      
			// on recuper le pseudo et le niveau
	//		String pseudo_r= request.getParameter("pseudo");
	//		String niveau_r= request.getParameter("level");
	//		   response.setContentType("text/html");
	  //          PrintWriter out = response.getWriter();
	  //         out.println ("hello "+pseudo_r+" <br />" );
	  //          out.println ("niveau : "+niveau_r+" <br />" );
	///			out.println ("Mot a trouver : "+mot_t+"<br />" );
	//			out.println ("Lettre tiree : "+car+"<br />" );
	//			out.println ("Mot mystere : "+mot_myst+"<br />" );			
		
    }		
	
}
